
<?php
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of correo
 *
 * @author federico
 */
class Correo extends Controller {

    function Email()
    {
        parent::Controller();   
        //$this->load->library('email');
        
    }

    public function enviar()
    {
       
       // $config['smtp_host'] = 'gmail.com';
        echo 'ACA!!!';
        $this->load->library('email');
        $this->load->library('form_validation');
        
        $this->form_validation->set_rules('username', 'Username', 'required');
    //    $this->form_validation->set_rules('password', 'Password', 'required');
        
      //  $this->email->initialize($config);
        
        if ($this->form_validation->run() == FALSE)
		{
		 echo 'error...';	
		}
		else
		{
                     
                  $this->email->initialize();
                  $this->email->from('antoniofmp@gmail.com', 'AnT');
                  $this->email->to('antoniofmp@gmail.com'); //aca poner que va al email de set_value("username");
                  $this->email->subject('PROBANDO');
                  $this->email->message('AXZCSGAQHSUSNJ');  
                  $this->email->send();
                  
                  echo $this->email->print_debugger();
                }
            redirect(login);
    }
}
?>